<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="com.asaga.tools.*, java.util.*, java.io.*, java.net.*, java.util.*"%>
<%--
     Author:  Jeremy Sanderlin 
     Date Created: 2007-04-01
     Last Modified: 2006-04-16
     Last Modified By: Jeremy Sanderlin
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="userProfile" scope="session" class="com.asaga.tools.SystemClient_DBImpl" />
<%
    String adminMenu = (String)session.getAttribute("adminMenu");
    TreeSet autismGroupMessageList = (TreeSet)session.getAttribute("autismGroupMessageTreeSet");
    AutismGroupMessage autismGroupMessage = null;
    Iterator itr = autismGroupMessageList.iterator();
%>
<html>
    <head>
        <%@ include file="header.jsp" %>
    </head>
    <body>
        <div id="container">
            <%@ include file="topNav.jsp" %>
            <%@ include file="leftside.jsp" %>
            <%@ include file="rightside.jsp" %>             
            <div id="content">
                <h3>Message</h3>
                <% if(itr.hasNext()){ %>
                <% autismGroupMessage = (AutismGroupMessage)itr.next(); %>
                <table width="100%">
                    <tr>
                        <td colspan="2">
                            <b>Subject:</b><%=autismGroupMessage.GetMessageSubject()%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Author:</b><%=autismGroupMessage.GetPersonName() %>
                        </td>
                        <td>
                            <b>Date Created:</b><%=autismGroupMessage.GetTimeCreated() %>
                        </td>
                    </tr>
                    <tr>
                        <td height="120" valign="top" colspan="2">
                            <table width="100%" border="1"  cellpadding="3" cellspacing="3"><tr `><td height="120"><%=autismGroupMessage.GetMessageBody() %></td></tr></table>
                        </td>
                    </tr>
                    <tr>                                    
                        <td>
                            <a href=reply_message.jsp?groupId=<%=autismGroupMessage.GetGroupId()%>&messageId=<%=autismGroupMessage.GetMessageId()%>>
                               Reply
                               </a>                                        
                        </td>
                        <% if(adminMenu.equals("admin")){%>                                       
                        <td>
                            <a href=AutismSiteMasterController?action=group&groupAction=removeMessage&groupId=<%=autismGroupMessage.GetGroupId()%>&messageId=<%=autismGroupMessage.GetMessageId()%>>
                               Remove
                               </a>
                        </td>
                        <% } %>                                       
                    </tr>                
                </table>
                <% } %>
                <hr/>
                <h3>Replies</h3>
                <ul>
                    <% while(itr.hasNext()){%>
                    <% autismGroupMessage = (AutismGroupMessage)itr.next(); %>
                    <li>
                        <a href=AutismSiteMasterController?action=group&groupAction=viewMessage&groupId=<%=autismGroupMessage.GetGroupId()%>&messageId=<%=autismGroupMessage.GetMessageId()%>>
                           <b>Subject: <%=autismGroupMessage.GetMessageSubject()%></b>
                            ,<b>Author: <%=autismGroupMessage.GetPersonName() %></b>
                            ,<b>Date Created: <%=autismGroupMessage.GetTimeCreated() %></b>
                        </a>                
                    </li>
                    <% } %>
                </ul>
            </div>
            <%@ include file="footer.jsp" %>            
        </div>
    </body>
</html>